package com.foreknow.demo11;

public class Person {
    private int age;

    public Person(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static void main(String[] args) {
        Person p1 = new Person(10);
        Person p2 = new Person(10);
        System.out.println(p1 == p2); //false
        System.out.println(p1.equals(p2)); //false 因为这里调用的是Object中的equals方法。
    }
}
